	/**
	 * 验证相关人员信息
	 */
	function validateImg(target){
		var cusName = $('#' + target +"_cusName").val();
		var cusNo = $('#' + target +"_cusNo").val();
		//var phone = $('#' + target +　"_phone").val();
		
		/*if((!cusNo || cusNo == '') && (!cusName || cusName == '') && (!phone || phone == '')) {*/
		if((!cusNo || cusNo == '') && (!cusName || cusName == '')) {
			if(target != 'subCustomer') {
				return true;
			} else {
				layer.tips('客户名称不能为空','#' + target +"_cusName");
				layer.msg("有验证未通过，请仔细检查！", {icon: 7});
				return false;
			}
		}
		
		if(!cusName || cusName == '') {
			layer.tips('客户名称不能为空','#' + target +"_cusName");
			layer.msg("有验证未通过，请仔细检查！", {icon: 7});
			return false;
		}
		
		if(!cusNo || cusNo == '') {
			layer.tips('身份证号不能为空','#' + target +"_cusNo");
			layer.msg("有验证未通过，请仔细检查！", {icon: 7});
			return false;
		}
		
		/*if(!phone || phone == '') {
			layer.tips('手机号码不能为空','#' + target +　"_phone");
			layer.msg("有验证未通过，请仔细检查！", {icon: 7});
			return false;
		}*/
		
		var ul = '';
		if(target == 'subCustomer') {
			ul = 'SHEN_FEN_ZHENG_MING';
		} else if(target == 'po'){
			ul = 'PEI_OU_SHEN_FEN_ZHENG_MING';
		} else if(target == 'db1'){
			ul = 'DAN_BAO_REN_SHEN_FEN_ZHENG_MING_1';
		} else if(target == 'db2'){
			ul = 'DAN_BAO_REN_SHEN_FEN_ZHENG_MING_2';
		} else if(target == 'db3'){
			ul = 'DAN_BAO_REN_SHEN_FEN_ZHENG_MING_3';
		} else if(target == 'db4'){
			ul = 'DAN_BAO_REN_SHEN_FEN_ZHENG_MING_4';
		}
		if(ul == '') {
			console.log('错误，请检查代码');
			return true;
		}
		
		var result = true;
		$("#" + ul + " li").each(function(index){
			if(index == 3) {
				return;
			}
			var imgs = $(this).find('img');
			var img;
			if(imgs.length > 0) {
				img = imgs[0];
			}
			var fileLabels = $(this).find('.img-layer');
			var fileLabel;
			if(fileLabels.length > 0) {
				fileLabel = fileLabels[0];
			}
			if(img) {
				var fileid = $(img).attr('fileid');
				if(!fileid || fileid == '') {
					if(fileLabel) {
						layer.msg('['+cusName+']' +$(fileLabel).text().trim() + "没上传", {icon: 7});
					} else {
						layer.msg("请检查附件是否上传完整", {icon: 7});
					}
					result = false;
					return false;
				}
			}
		});
		return result;
	}
	
	$(function(){
		$("#commentForm").validate({//重写showErrors
            showErrors: function (errorMap, errorList) {
            	$.each(errorList, function (i, v) {
            		layer.tips(v.message, v.element, { time: 1500 });
            		
                    return false;
                });
            },
            /* 失去焦点时验证 */
            onfocusout: false,
            /*  键盘抬起不验证 */
            onkeyup:false,
        });
		
        $("#commentFormb").validate({
        	 rules: {
                 "subCustomer_cusName":{
                     maxlength:15,
                     chinese:true
                 },
                 "subCustomer_cusNo":{
                     isIdCardNo:true,
                     maxlength:18
                 },
                 "subCustomer_phone":{
                 	mobile:true
                 },
                 "po_cusName":{
                 	maxlength:15,
                 	chinese:true
                 },
                 "po_cusNo":{
                     isIdCardNo:true,
                     maxlength:18,
                 },
                 "po_phone":{
                 	mobile:true
                 },
                 "db1_cusName":{
                 	maxlength:15,
                 	chinese:true
                 },
                 "db1_cusNo":{
                     isIdCardNo:true,
                     maxlength:18
                 },
                 "db1_phone":{
                 	mobile:true
                 },
                 "db2_cusName":{
                 	maxlength:15,
                 	chinese:true
                 },
                 "db2_cusNo":{
                     isIdCardNo:true,
                     maxlength:18
                 },
                 "db2_phone":{
                 	mobile:true
                 },
                 "db3_cusName":{
                 	maxlength:15,
                 	chinese:true
                 },
                 "db3_cusNo":{
                     isIdCardNo:true,
                     maxlength:18
                 },
                 "db3_phone":{
                 	mobile:true
                 },
                 "db4_cusName":{
                 	maxlength:15,
                 	chinese:true
                 },
                 "db4_cusNo":{
                     isIdCardNo:true,
                     maxlength:18
                 },
                 "db4_phone":{
                 	mobile:true
                 }
            },
            //重写showErrors
            showErrors: function (errorMap, errorList) {
            	$.each(errorList, function (i, v) {
            		layer.tips(v.message, v.element, { time: 1500 });
            		
                    return false;
                });
            },
            /* 失去焦点时验证 */
            onfocusout: function(element) {$(element).valid(); },
            /*  键盘抬起不验证 */
            onkeyup:false,
        });
	});
	
	